Viable cosmology in bimetric theory