add scoring logic for reference selection