making apply_table function

cccc