Working implementation of Ackermann's Function