finished translating bk 2 ch 2 examples into Swift