Made cd into its own function