Move peak-detection to function for reusability. add some numbers to the
text