Solving problem of week 3