weights of wavefunction now in output file and modified function to calculate electron density