modified code / formatting
updated demo