added proper unit testing