solution for second practice
solution for third practice