working version
tidied up