Bubble sort complexity So I have this code:

  done &lt;- false                                     [1]
  n &lt;- 0                                            [1]
  while (n &lt; a) and (done = false)                  [(n+1)(1+1+1)]
    done &lt;- true                                    [n]
    for m &lt;- (a- 1) downto n                        [n(1+1+1+1)]
       if list[m] &lt; list[m - 1] then                [n]
         tmp &lt;- list[m]                             [n]
         list[m] &lt;- list[m-1]                       [n]
         list[m - 1] &lt;- tmp                         [n]
         done &lt;- false                              [n]
       n &lt;- n + 1                                   [1]
  return list                                       [1]


Am I doing this right? My conclusions are that the inne for-loop runs (n^2 + n) / 2 times and the outher while-loop runs n+1 times. I don't know how to properly argue for that the bubble sort has the complexity O(n^2)
There is just one loop in for, so the number of steps here will be proportional to n not n^2. The outer loop is running in a n proportional number of steps too. So The complexity of your algorithm is n^2.
N.B. : When speaking complexity, you don't have to state (n^2 + n) / 2,just say n^2 because they are the same for big ns.