Added tank memory and error checking for tank behavior.