replace select with for