fixing plotypus.py to accomodate Earl's changes. Also cleaning up some code