code all refactored. games class fixed.