deleted a bunch of unneeded code, improved functionality