added printPattern method.
remove output again.
small change.