Implemented automatic peak and back selection.