Using pointers rather than arrays, improved pivot