typo: $++x instead of ++$x