added singleton pattern

From my blog