magma works; need to optimize matrix setup