Fixed a minor bug and prepared for documentation