modified random.hs