Fixed some bugs and cut out extraneous code.