add backports for array#sample