got it closer to working properly
Added new checks for peak