Fixed potentials calculation, added parse to double from file