Fixed undeclared variables and unneeded arguements