finished off first draft f pivot selection
fixed pivot selection