added other ways to solve the problem #4