added option to use dynamic eigen classes