Added peak function