modified match 3 functionality