Initial GS algorithm