1st problem solution w/ less brackets