MAX_DIM=3
added some tests for quick regression checking