moved angle calculations to its own class