Code I used for tutoring my cousin.