Debugged lots of functions