finished exercises from section 2.2.1