added a lot of unit tests