removed comments and the old implementation of sampling from an array