add logging and plots