functions to create procedure