added tests to cover all functions