Switched > to < in for loop