tidied up example