fixed ex3 - better handling of int conversion