Tom, If your 40 gallon tank runs out of hot water quickly, either the lower heating element is out or something is wrong with its thermostat.
Be sure that the circulation loop is well insulated, otherwise you will be losing heat through it and will be paying for lost heat on your electric bill. The most modern way to go with the pump control is a remote switch in the kitchen or bath that runs the pump for maybe a minute or two, just to bring hot water to the point of use.
Electric water heaters could be as fast as gas, but the power companies were afraid of the demand with two 4500 watt elements operating simultaneously in thousands of homes, usually at about the same times like when everyone is getting ready to leave the house in the morning. Wiring from the water heater all the way back to the power plant would have to be heavier so electric water heaters heat the top third or so of the tank to the desired setting using the top element which used to be 4500 watts in "quick recovery" water heaters, then switch to the lower element to heat the bottom 2/3s of the tank.
One of Carter's proposals for the energy crisis was that all new construction would have to heat a percentage of the hot water needs with solar, but Ray Gun came in with his fossils, I mean fossil fuel people, and scrapped all of that.