Fix code.
REfactor scoring method to standalone file.