modified index and main