Writing data generator for lab4 (not finished)