Use a array for indexing

dirty draft