updated from_bin