Added score generating logic.