fixed typo and function names