cretated a function