renamed function.
added duplicate check to cursors picking
removing duplicate results from final output.