Remove a bunch of debugging code and put scan codes back