can we write a procedure inside the function? and the reverse?