program now works better, added plotfile