Updated Makefile
Removed type ambiguities and extraneous imports, improved function definitions