Added implementation of a recursiv algorithm