Well, we could indeed accept the object, but always return an array which is a copy, without modifying the real one. After all, the user probably want to get the peaks, not change the base object.