wip. bug fixes, prototype of java write directives