solution for 4, analysis of 5