added comments to the code and fixed the wake log alert bug