my own version of Array.sample