started coding for pivot