add initial code for index and logic