cleaned up input of M, N, bc, etc. Only for 1d. Need to make same changes for 3d