partial solution to 2.5