iDecl ((DProc ident params decl stmts):tail) stm = do {
    env <- askEnv;
    envParams <- runNewEnv env addParamsToEnv params ;
    envParamsDecls <- runNewEnv envParams addDeclsToEnv decl;
    loc <- alloc TFunc;
    recursion_env <- return $ M.insert ident loc envParamsDecls;
    putToStore loc (createProcedure params stmts recursion_env);
    localEnv (M.insert ident loc) (iDecl tail stm);
  }
  where
    -- TODO fix id
    addParamsToEnv decl = iDecl decl []
    addDeclsToEnv decl = iDecl decl []
iDecl ((DProc ident params decl stmts):tail) stm = do {
    env <- askEnv;
    envParams <- runNewEnv env addParamsToEnv params ;
    envParamsDecls <- runNewEnv envParams addDeclsToEnv decl;
    loc <- alloc TFunc;
    recursion_env <- return $ M.insert ident loc envParamsDecls;
    putToStore loc (createProcedure params stmts recursion_env);
    localEnv (M.insert ident loc) (iDecl tail stm);
  }
  where
    -- TODO fix id
    addParamsToEnv decl = iDecl decl []
    addDeclsToEnv decl = iDecl decl []
iDecl ((DProc ident params decl stmts):tail) stm = do {
    env <- askEnv;
    envParams <- runNewEnv env addParamsToEnv params ;
    envParamsDecls <- runNewEnv envParams addDeclsToEnv decl;
    loc <- alloc TFunc;
    recursion_env <- return $ M.insert ident loc envParamsDecls;
    putToStore loc (createProcedure params stmts recursion_env);
    localEnv (M.insert ident loc) (iDecl tail stm);
  }
  where
    -- TODO fix id
    addParamsToEnv decl = iDecl decl []
    addDeclsToEnv decl = iDecl decl []