Excercises in Eloquent Javascript, Ch. 2