Attempted to make it so that arrays are encoded correctly