fixed up algo recursive post