string to integers - added input restriction option