more test and correct the logic again...
correct to_assignment function
more test and correct the logic again...