modifications to nutnr function