Added key as input to pivot table function paramters