Code and Makefile update