changed the way the Thread works