Talk to a commercial lawyer and have them draft your agreement for you. These agreements are tricky! Even a small error could result in disproportionate consequences years down the road.