adding and fixing unit tests