added weighted and limited queries