Tidied up defunct code and unnecessary prints