removing a completely unneeded function
removing another completely pointless function
removed unused var
removed more warning and some pointless vars
missed a function def