1. formatting 2. commenting 3.  added logLevel to shared function for writing to host for better formatting,