Added unit test scripts and updated the required changes in the code to meet up testing requirements.