implemented question 2 fact as tail recursive function
added missing app.config as it appears to be required to run tests