modified code----