% token in patterns implemented; unit tests added