PY: Current working version of the peaktrough, but definitely can use some cleanup.