First working version with immutable nodes