all calculator function modularized