changed table function