added a sort to printDir() so it prints dirs first, file second and