now the 2d calculation seems to work