implemented weighted scoring

this can be shortened by

```php
// either
return $a->getPriority() - $b->getPriority();
// or (I can never remember this)
return $b->getPriority() - $a->getPriority();
```