works correctly now

reports errors if non-integer or integers outside the range are
specified