refined lesmisgame code