tests and fix to mid angle calculation