testInput() optimization