Unit Testing

Minor changes to code and Added Unit Testing