Added makefile reduced redundent code and added comments.