modified python script for nicer plot output