small optimization for first exam task