Added functions and Makefile