The logically correct and more elegant fix for the issue where goTo(0) wouldn't work

All other solutions are wrong or not so correct/fast logically. It's elegant because it makes all work by only adding one missing else.