solution for Rankall 8-10