removed table.stack (performance very bad)