adding scoring and global flags