reverse loop instead of array