working example

but need some improvements