Got rid of a lot of debug and old unused code