added makefile, minor refactoring, better timer-function