added proper unit tests