grid axis aligned ray problem