Minor changes

Minor changes to the code, and cleaned up a little