nn function added to remove None from result array