Adding array handling logic.