Got rid of all warnings, added Makefile, made core function "apply" more useful