Made all calculations run in their own thread so an indeterminate
loading bar can be shown while calculations are performed