implemented the rest of the directory functions