Cleaned up code a bit, removed unneccesary printouts and leftovers from debugging the overflow problem