Statistical mechanics of glass