added support for buffered code