Changed to base on 1
Added recursive version