added options parsing & dense/sparse input