Clarifications
Simplifications and an added trapezoid function