working version with right score