refactoring the cod of composing result into a compose function
refactoring of the compose method
enhance the test file for showing test cases numbers
work for n level
fix the failed test case
 format the code