refined code for typing games to resolve the difficuly bar issue