gave credit for randint function