oppg 2.2 as a function