cleaned up formatting
better warning messages for unlikely out-of-range arguments.