Fixed random stuff. Algorithm implementation basically finished. Debugging and refactoring needed though.