Modified to be a generic base for creation of functions
Renamed a few things
Tests modular, with basic use case