tested code for memory leaks, made some minor revisions to dir.c / cat.c and tested again