made corrections according to Ray comments