Added function definitions as requested by Reporting team, it's commented as I'm not sure what they want.