maxmodnd() working in 1d