Finally I draw the peaks. But still with the bad algorithm