Tidied up some outputs and logic