save function expanded to save input for BNs