I just noticed, that you can easily overflow variable mult after just 5 iteration.
You can just store number of 0 in that variable, or something...