Update exercise6.r