Castlegame code cleaned