Ricart Agrawala algorithm seems to work