added more tests for the worker. cleaned up and fixed bugs as I went