Work on ray casting algorithm