added rudimentary ring condition, fixed bridge and fork conditions,
added tests for conditions