lambda function to remove zeros from the list before difference is calculated