Added main function for easier profiling