added type analysis, first part