Added CreateAThread function