unit tests and bug fixes xoxo