Added mod recursion for recursive call testing.