more flexible function to cd to the newest directory