cleaning up some code

Worked a little on code and cleaned it up a lot.