Add functions for logging program