Updated ray casting cont.