initial implementation of buffer program