First rev of integer encode.