I will talk about the global smoothness of solutions to the Monge-Ampere equation with the second boundary condition. Besides its important connection to the optimal transport problem, it has many interesting applications in geometric problems such as prescribing Gauss curvature problem and minimal Lagrangian graphs. The talk is based on joint works with Jiakun Liu and Xu-Jia Wang.