added ex3 for Ray