Added comments and made variable easier to read