Added makefile and got closer to completing protocol functions