terminate all workers at the proper time
check for NaNs in normalize()