Some algorithm improvements, UI improvement.