setup for GI algorithm