Added several helper functions.