massive refactoring in hopes of better peak matching... not sure if it's working yet