Using a different method to check for array