changes made to srini's code