More work on functions and test harness