removed duplicates, renamed buffers to include int in name, fixed deadlock