adding helper code