Some fixes,new score function