Adding Sumit's code.