Removed more testing code, added more logging