Proper ray casting added.