finished the 2nd method for plotting charge stability diagram, but still very slow