refactored Index.java after a night of rest