working ver of function #1
completed functions 1 - 3 and added tests