commented and cleaned up a bunch of stuff