wip reimplemented with callbacks - now to complete testing