Enhance the code.

Make loop iterations from N*N to N by enhancing Menu API.