FoldLeft2 and ack in scala