cleaned up and commented python code, in addition to fixing graph axes