latest update with pivot functions running