Replaced randint() with randrange()