working on unit testing and fixing bugs