cleanup
cleanup
cleanup
added 'tail' parameter to write_irreg
cleanup
add 'tail' parameter to write_bits
cleanup
cleanup
cleanup
cleanup
cleanup