Made fixes to get it to run (up until upload), and removed some debug statements