yet another small optimisation for task 1 of exam 4