Updated read function