Updated comments in flatten_with_extends and added compare_with_extends
Updated example in main function
Updated example with flatten_with_extends and compare_with_extends