Mode computation is working, except for the k=0 mode.