Add analyzeInput method. Fix scanner to work with analyzeInput.