add function area and reimplement max-data-points using new time-window function