add basic negotiation code
add test script