fix orientation/weight coding