Make mod function applicative
Use Array.isArray