Functional version with everything.