starting to look mildly functional

Using higher order functions and no class now.