added bitio write, tests of all function up to now