optimise grid plot and refactor painted desert example