Fixed makefile to reflect project param. Fixed memory leak. Added comments