implemented simple first peak detection, changed ploting functions to support ploting vertical lines