added optional argument "shuffle" to randomize samples before submitting them (testing purposes)