First step (not yet tested) towards pivot table