Index and Flat Ends of Minimal Surfaces