fixed mapping function bug. endAngle bug