Added some more comments. Removed some useless code. and cleaned up some stuff.