redundant code removed, and cleanup of console debugging