add encoding for ints
add encoding tests