added zagzag method