Updated Diwakar's changes