Brought back some lost unit testing code
Added code for unit testing