Finite element computation of sloshing problems in a rectangular container