Updated function signatures to respect BC 
Removed unnecessary intermediate variable 
Updated parentNode clause location in where order
Updated unit tests to verify new function parameters and BC conformity