added min/max range to readInt