added comments and created pattern code.