dir.c cleaned up