Properly handles errors.  Still need to do calculation.