improved range 0 to x-1 warning