Little modification on def random()