finalised contract generation