test phase1
add length function and use it for testing phase1