Encode double (crap code)