Algorithm skeleton completed