added a contract based example