solution for second practice