Add magine function, make test suite pass