Addded partial support for 2d problems.