major code cleanup and fixes, added some print statements for debugging while testing, removed bytestring conversions