added helper function for creating and changing into new directories