start of sorting table behavior