unit test functions

took functions out of the comment box and wrote some test cases for them