added tests; refactored compass