Fixed by with undefined  property; added simple comments.