basic working calc function