added the dir function