Removed all debug lines, moved a lot of shit around