Added Queue and rudimentary threading functionality