cleanded up code and removed some unecessary code.