The code looks ok, but should I not use somekind of trace from the box downwards to detect the slope/surface angle? And how do I aply the trace to this code? Thanks.