made changes for pivot table