updated the tests and brought code up to scratch
updated tests and added thread safe methods