solved first problem of homework 1