A method for removing and preventing undesired twists and coils in a pool cleaner power supply cable extending between a remote power supply and a self-propelled pool cleaner, the pool cleaner moving on the bottom and/or side walls of a swimming pool during a cleaning cycle according to a scanning algorithm directed by a microprocessor on board the pool cleaner, a directional controller on board the pool cleaner for changing the directional heading of the pool cleaner in response to signals from the microprocessor, said method being characterized in that it comprises the steps of a. providing a memory device operatively coupled to the microprocessor for storing the scanning algorithm; b. providing the swimming pool cleaner with an electronic compass for determining the actual directional heading of the moving pool cleaner; c. transmitting a reference directional heading of the moving pool cleaner to the memory device as determined by the electronic compass upon initiation of the scanning algorithm; d. transmitting a series of actual directional headings of the moving pool cleaner to the memory device during the cleaning cycle; e. comparing each of the series of actual directional headings of the pool cleaner with the reference directional heading and transmitting to the memory device for storage of the result of each comparison in the form of a positive or negative value to represent, respectively, a right or left deviation value in degrees from the reference directional heading; f. registering the completion of an entire turn either in a number of right turns or a number of left turns depending upon the left or right deviation from the reference directional heading, when the cumulative difference between the subsequent actual directional headings and the reference directional heading is equal to, or greater than 360°; and g. turning the pool cleaner to the left when the number of right turns is greater than a predetermined number of left turns and turning the pool cleaner to the right when the number of right turns is less than a predetermined number of left turns, until the number of the right and left turns are equalized. a. providing a memory device operatively coupled to the microprocessor for storing the scanning algorithm; b. providing the swimming pool cleaner with an electronic compass for determining the actual directional heading of the moving pool cleaner; c. transmitting a reference directional heading of the moving pool cleaner to the memory device as determined by the electronic compass upon initiation of the scanning algorithm; d. transmitting a series of actual directional headings of the moving pool cleaner to the memory device during the cleaning cycle; e. comparing each of the series of actual directional headings of the pool cleaner with the reference directional heading and transmitting to the memory device for storage of the result of each comparison in the form of a positive or negative value to represent, respectively, a right or left deviation value in degrees from the reference directional heading; f. registering the completion of an entire turn either in a number of right turns or a number of left turns depending upon the left or right deviation from the reference directional heading, when the cumulative difference between the subsequent actual directional headings and the reference directional heading is equal to, or greater than 360°; and g. turning the pool cleaner to the left when the number of right turns is greater than a predetermined number of left turns and turning the pool cleaner to the right when the number of right turns is less than a predetermined number of left turns, until the number of the right and left turns are equalized.