Final Version--code synced with Alex