calculate expenses