Convert gains to use a piece-to mapping