added code for populating buffers
added code to populate buffers