call #compact to remove nils