added tools.c and tools.h in src folder