add VERSION encoding, with test