added some generic arithmetic function