addition of find_energies.py and replace.py