Added randomize function