error in mode calc

w/o the change mode([1,1,1,2,2,3,3,4,4]) results 4