changed ran dint to randrange