Adding fences functionality