commented out thread.join loop because I don't think it is needed