clean up code.
add Makefile.