add additional logging and documentation