almous done. need to fix indexing