Fence data structure

Fences connection data structure and algorithms