setting up function