fixed bug where peaks were pre-emptively removed