chpt. 6 revised + code