Made solution to 18 more readable