refactored and function tests implemented
Merge pull request #7 from peggyfox/refactor_and_tests

refactored and function tests implemented