cleanup up some code, two new exp functions which take vector of dimensions