Shortened the range validation code

Signed-off-by: Exikle <dixondcunha@hotmail.com>