Updated to add read function.