fixed history variable bug and added a better score counter