production remainders function was added