O(m*n^2)?? 

Suggest breaking this into multiple lines. This is incredibly difficult to read, and no benefit is obtained by doing this in a single line