major changes: logging and ts setting