finished decentralizing code