slight loop improvement