A numerical technique for solving the maxwell model for free surface flows