Add write buffer test
Modify peterson algo
write buffer update