cleaned up a little bit and removed some unneeded code