use memcpy to copy structure, fix some errors also
Add test_bound to test all boundary function