adding loops and forward paths