added test code for egcd.