Compiled if_id and id_mex. some more work on mex_wb