move calculation to server