refactored concave edges drawing code.