A COST EFFECTIVE TWO STAGE OPTIMIZATION MODEL FOR MICROGRID PLANNING