why are elements iron cobalt nickel magnetic