[MODIFIED] Initialize 'z' when adding a buffer so that sorting can be consistent.