adding revised code.