Minor changes -- NOT WORKING -- Problems with thread