Added readvalue function