setting  up function