added comments, logs, minor changes for demonstration