Fixed some typos, changed the variables in the constructor into private variables, reformatted the code a little bit, and added more comments.