Didn't need to import random.
added some comments for readability.