Added recursive function for 2.2