added console log with comments