Better code, added cd number support