improve solution for 2.3