Adding JDG tutorial + code corrections

Pull request for reviewing the tutorial