renamed some function names