Added re-implementation of example provided by monkeyiq