Added map approach to processing input.