A few things to think about:
1. Why do you have i++ on two places in your for loop in your pick method?
2. What should happen to i when a duplicate is found, should it still be increased?
I think these things should correct your problem, if not, please state what the program does and what you think it should do instead. Good luck!