Added isArray function