Adding debugging options and cleaning up some code