Fix code assignment at cap, all tests passing.