Implemented quick and dirty select with indexes.