Cleaned up makefile, made functions static