add vars and flexible hidden layer