added the data generating code