working version from the tutorial

Signed-off-by: Graham Chiu <compkarori@gmail.com>