Fix ::rand bug that doesn't accept range as parameter and replace with Random.new.rand(n..n)