Lots of refactoring. Started guesswork on amplitude...