combine function and other helper functionas added. test cases due for meld