new cd function working properly