@ranjith-imagnate  please add logic as comments over here.