the optimize version
add origin test