Added makefile for compilation outside of xcode
Fixed bug which resulted in overuse of memory
code cosmetics