move less to function to speed up sort