This document presents a study that combines plug-in electric vehicles with vehicle-to-grid technology (V2G), renewable energy resources like wind and solar, and existing power plants, to optimize unit commitment in smart grids. The goal is to minimize total costs and emissions. A genetic algorithm is used to optimize scheduling of generation units, V2G vehicles providing spinning reserves, and time-varying renewable sources over a 24-hour period to meet load demand at lowest cost while satisfying constraints. Simulation results validate that integrating V2G and renewable energy sources can effectively reduce costs and emissions for the smart grid.