My favourite function for generating random numbers