rearranged the functions
merge done