added full code example