added repeating and randomizing functionality to test.html