Updated logic for arithmetics - more working functionality now