solution of homework 2