condensed a lot of unneeded code