Solve second week assignment