many fixes, and big improvement to ranked relevance due to a new algorithm for ranking