added comments and refactored Makefile