finished ackermann implementation