debugging preoblems with indexing and missing values and incorrect values