fix functions and rename files in Makefile