refactored function names, still need to add two more functions