work on chpt. 4 and code layout