added functional and unit testing