Add comment and main function for opimization