mher: Working version, needs refactoring.