creat function