I put some relevant ideas here:
Some of it was aimed at a beginner but there may be something useful there.