Fixed debug function.
    Dubug function no longer calls date outside of function.
    Removed time_diff and time_end variables.
    Cleaned up debug calls.