split code into several files, Makefile now automatically generates dependencies