updated code for cdkMainViewController

updated working code