correct solution to 2(a), plus Sabah's version