main and read data