Updated algorithm section by adding five step structure. Added dealing with spin connection section.