Added the required variables and the procedure function