partial solution to wk5_5