added random sequence generator