Made data members private, bugfixes, tweaks, and comments.