inArray function added