Adding config stuff and getting thread working