pivot table procedure conceptually works