errors in functions

had to fix errors inside and out of function