Removed some unneeded code. Made several small changes.