updated A3 and A3_test with new code