This is a working version with the new implementation minus messages