Tidied but some imports and print statements