Added comments and switched try with if
Added RAG merge_nodes test case