Added some comments explaining different methods.