Added supporting functions.