added methods to check if a ray hits a box