Threading is now working, still to implement is a shutdown command