Makefile and main improved