Encoding using arrays instead of single value