advaswitch example code added. Code cleaning