visual tidying up and implement demo function