fix calculations, credits Lexxes