Added features to buffer code.