compute on the client side