fixed error in generating coprimes