updated debug() function. repaired date command