C++ abs takes int! swap_rows forgot half of work rows.