Added more comments, changed some primitive ints to Integer class for
handling null values better.