fixing second problem

changing the second problem to a better solution