Commented part_3_functions.pl

Add comprehensive comments for each function