Implemented naive range query (pruning based on probability at the end)