Final Commit: Bug fixes, User Manual

Added user manual, fixed infinite loops which could cause overflow and
other minor bugs.