trying to implement table sort