added directory handling and makefile