Reworked function simple_table and fix bug