You can also use my recent answer where I put all together in the comprehensive set of instructions with explanations and source code samples.