Moved Encode and Decode to lmv and unlmv