Moderate refactoring; added critical path, predicted goal detection and highlighting