Added new procedure and boolean function to code.