added read function (didn't compile w/o it)