working with complex numbers and pthread