Created validator function
created checkbounds