changed input for generatepatterns, and fixed currentlabel problem