improve var naming
implement optimistic locking for updating the head