change arg of data_free
add description and new implementation of all the functions, add union operation