changed things to use mvars instead of iorefs...oops