clean up of autogain code (#2651)
clean up of autogain code (#2651)

walterbender/turtleartmini,walterbender/turtleflags,walterbender/turtleart,AlanJAS/turtleart,walterbender/AmazonasTortuga,walterbender/turtle3D,walterbender/turtleconfusion