First stab at binary encoding