refactor code
refactor code 2
fix Makefile