added makefile and finished main logic