Fix bug in frank energy calculation

Remove usage of ran2 and make indentation consistent.