u/l code and output from Rich Leung