added tests and fixed angle comparison