encodes arrays