Fixed calculation logic

- fixed the problem where negative numbers weren't taken into account
correctly for * and /
- fixed the problem where adding a negative number would cause an
infinite loop or other problems
- fixed the issue when having a negative sign in element 0

- added std::move and replace for insertion