Cleaned up CommonFunctions.py