simplified tutorial code.