Added unit tests and functions to classes