documented and also cleaned up the console log