Completes BetaHanto functionality, but needs javadocs and refactoring.