the first way i was doing this was clearer