Finish implementing contract functionality