Edited result_read function