fixed bugs, calculated score