Added more comments; organized methods.