Made required changes as suggested in Patch:3