trying to improve the solution