moved arithmetic operations, and simplified them