Works fine now. Calculation part is correct. I send the code to a friend. It works now. Dunno what he did.