change pattern storage to linked list

only works for runPattern() right now