main function name changed to index