TOO slow for BIG n, about 2 add hashmap for indices