Better naming and check for empty arrays