did some more tweaking to sort and limit