working example, but need some test/fix

Need to check it, i think works, but not sure.