added some comments and removed a one-liner