implement better and faster pattern matching. Update version.