pattern iterator custom