factorial example runs but still need to refactor