added main index and fixed stuff