finished problem 002, using modular comparison