fixed bug relating to how reference configuration is set. added command line argument for switching between 2 and 3 dimensions