used ``_mexpand``; small change in ``check_solutions``