more comments and changed 2 conditional to one line conditional statements