small refactor and added tests for interimDirection/Angle