working test and code
added log_date and cleanup
formatting