Refactor solitaire code to work with crystals