2 errors in functions