added read function