implements reading data