decalre read function