changes in peak function