commit before merging and testing code to calculate peaks by averaging neighbors on P_f