Cleaned up heuristic code and added chebyshev.