Added recursive function definition