fixed some code added 4 patterns