Put this code in a loop. It's a lot better than what you had before.