better data formatting (proper array detection)