added peaks function

Not for use on the web, ignore