trial save and change - got rid of all print statements and tidied up
code