contract implementation