Solving the Helmholtz equation for membranes of arbitrary shape