This I think will consume a lot of stack space if it recurses a lot of times. I guess loops are a more efficient way of implementing this.