test added for  n % m > 0 cases