added binary_read function