Revised log functions
Added comments for functions