use tuple destructing in for loop to simplify code