corrected do-while with $x * $x