helper functions and makefile