refactored old solns to use pimped integral