inlined some functions, makefile update