Switched to loops for all places appropriate