solution in comments