Added file for test cases
Refactored code, added header file and modified makefile