basic readout code implemented