update makefile and rewrite somefiles