migrated to math.js for complex numbers