Changed main function to JS naming convention.