moved cd function