main changed to index