Nacogdoches hospital lays off 40 positions