wrapped up code for demo