Complete the contract part still left with two bugs