updated for zerocrossings and extrema
added ISMAX keyword
added FALLING keyword