using buffer