better array handling. more tests