rough sketch of plotting and type checking