Added simple functional test, and helper function