improved pivot example