added tests for nested conditions