slightly better array handling