Fix #11 in first approximation, table sort added