fixed issues with linearization and linearization order