EOL and SOL, working only first time xD

rezultat += str*;*
Won't this just keep getting added to with every pass? I don't see anything that resets it.
Try printing it, see if it just gets longer & longer.