always create dx (we should really encapsulate the linear algebra stuff in classes with constructors)