Replace fraction check with just min energy in 2nd sampling
The main change is to remove the usage of the fraction tool and just do a check on the minimum energy in the 2nd sampling.
Some other changes on indentation , obsolete messages are also included