Trying to figure out some more functions

I will from now on also comment out any unused (in function) variables