add -pedantic
use more descriptive name (dim) for functions and variable related to dimensions of state space