tail recursion implementation on account parser