finished chapter4 of functionaljs