refactoring source file and added make file