Added horizontal plane detection for adaptive slicing