added spare calculation to own function for clarity.