adding d_input so do not have to alloc memory for every call to eval