Continued main algorithm work and debugging.