add dimensions as encode argument