made changes to peak to make it more abstract