Added a procedure and some functions.