     IN intmethod integer,
     IN classmethod integer,
     IN steps integer,
-    IN resolution integer DEFAULT -90
+    IN max_time integer DEFAULT -90
     )
 RETURNS TABLE(
     the_geom geometry,

DECLARE
    cell_count integer;
    tin geometry[];
    max_time integer;
BEGIN

    -- calc the optimal number of cells for the current dataset
    max_time := -1 * resolution;
    SELECT
    CASE intmethod
        WHEN 0 THEN round(3.7745903782 * max_time - 9.4399210051 * array_length(geomin,1) - 1350.8778213073)

CREATE OR REPLACE FUNCTION CDB_Contour(
    IN geomin geometry[],
    IN colin numeric[],
