Mostly-working implementation of axisfunction