adding solution for 3 problems