Thunder strike debug berserk...

Print everything and try to know what is going on, the calculations seems
ok but the result on the screen is just a mess.