did some work on writer.c. not yet compilable.